<?php
$g_start_time = time();
require_once($r."_engine/mail_functions.php");
require_once($r."_site_struct.php");
require_once($r."_inc/colors.php");
require_once($r."_inc/text.php");
require_once($r."_header_ext.php");

$html_title = "W3Monitor | " . $title;

// Exclude dynamic of styles in Opera for select tag, to avoid bug
// (when last option is selected, and change class in onBlur event,
// then Opera change combobox value to selected item [default])
$is_opera = is_int(strpos($_SERVER["HTTP_USER_AGENT"],"Opera"));
$select_style_part = "class=\"input2\" onFocus=\"this.className='input2_act'\" onBlur=\"this.className='input2'\"";
if ($is_opera) $select_style_part = "class=\"input2\"";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<link rel="shortcut icon" href="<?=$r?>images/favicon.ico">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="generator" content="hand made">
	<meta name="keywords" content="W3Monitor">
	<title><?=$html_title?></title>
	<link rel="stylesheet" type="text/css" href="<?=$r?>css/main.css">
	<script language="javascript" type="text/javascript" src="<?=$r?>js/ajax.js"></script>
</head>


<style type="text/css">
BODY {
    background: url(<?=$r?>images/bgnd.png) repeat-x #3E4F57;
}
LI {
    list-style-image: url(<?=$r?>images/yellow_arrow_5.gif);
}
</style>

<script type="text/javascript" language="JavaScript">
var g_site_root_ajax = "<?=$g_site_root_ajax?>";
</script>


<body>
<a name="top"></a>

<table width="900" height="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td height="30" align="right">

<table width="100%" height="90" border="0" cellspacing="0" cellpadding="0">
<tr height="1">
	<td rowspan="2" style="padding-top: 9;" align="left">
<?php
echo make_link("home",
    '<a href="[%HREF%]">[%TEXT%]</a>',
    '[%TEXT%]',
    array(
        'HREF'=>$r.'index.php',
        'TEXT'=>'<img src="'.$r.'images/logo.gif" height="73" alt="W3Monitor Logo" border="0">'
));
?>
    </td>
    <td align="right" valign="top">

<?php
$t1 = '<a href="[%HREF%]" class="aTopMenu">[%TEXT%]</a>';
$t2 = '[%TEXT%]';
?>
<table>
<tr>
<td class="topMenuLogin">
		<!-- AddThis Button BEGIN -->
	    <span>
		<script type="text/javascript">
		var addthis_pub="w3monitor";
		var addthis_header_color = "#ffffff";
		var addthis_header_background = "#5d6a71";
		</script>
		<a href="http://www.addthis.com/bookmark.php?v=20"
		onmouseover="return addthis_open(this, '', 'http://www.w3monitor.com', 'W3Monitor - service that monitors web resources of your interest')"
		onmouseout="addthis_close()"
		onclick="return addthis_sendto()">
		<img src="/images/btn_addthis.gif" alt="Bookmark and Share" style="border:0"/></a>
		<script type="text/javascript" src="http://s7.addthis.com/js/200/addthis_widget.js"></script>
		&nbsp;&nbsp;&nbsp;</span>
		<!-- AddThis Button END -->
    </td>

<?php
/* ----- Top Menu for active session: BEGIN ----- */
if ($g_session->IsActive()) {
?>

	<td class="topMenuLogin">
<?php
	echo make_link("defaults", $t1, $t2, array(
	    'HREF'=>$r."members/defaults.php",
	    'TEXT'=>"Settings"));
?>
    </td>
	<td width="10"></td>
	<td class="topMenuLogin">
<?php
	echo make_link("profile", $t1, $t2, array(
	    'HREF'=>$r."members/profile.php",
	    'TEXT'=>"Profile"));
?>
    </td>
	<td width="10"></td>
<?php
}
/* ----- Top Menu for active session: END ----- */
?>
	<td><img src="<?=$r?>images/sign_in.gif" width="18" height="17" alt="" border="0"></td>
	<td class="topMenuLogin">
<?php
if ($g_session->IsActive())
{
	echo make_link("logout", $t1, $t2, array(
	    'HREF'=>$r."members/logout.php",
	    'TEXT'=>"Sign Out"));
}
else
{
	echo make_link("login", $t1, $t2, array(
	    'HREF'=>$r."members/login.php",
	    'TEXT'=>"Member Login"));

?>
    </td>
	<td width="10"></td>
	<td><img src="<?=$r?>images/sign_up.gif" width="19" height="19" alt="" border="0" align="middle"></td>
	<td class="topMenuLogin">
<?php
echo make_link("signup", $t1, $t2, array(
    'HREF'=>$r."newcomers/signup.php",
    'TEXT'=>"Sign Up"));
	
} //if session is inactive
?>
    </td>
</tr>
</table>

    </td>
</tr>
<tr>
    <td class="topMenu" align="right">

<?php
$list = array();

if ($g_session->IsActive())
$list[] = array('p'=>"cp",             't'=>"Dashboard", 'h'=>0);
/*
$list[] = $g_session->IsActive() ?
    	  array('p'=>"cp",             't'=>"Dashboard") :
          array('p'=>"demo",           't'=>"Demo");
*/

$list[] = array('p'=>"features",       't'=>"Features", 'h'=>0);
$list[] = array('p'=>"case_studies",   't'=>"Why W3Monitor");
$list[] = array('p'=>"signup",         't'=>"Free Trial", 'h'=>1);
$list[] = array('p'=>"plans",   't'=>"Plans & Signup", 'h'=>0);
$list[] = array('p'=>"faq",            't'=>"FAQ", 'h'=>0);
$list[] = array('p'=>"blog",            't'=>"Forum", 'h'=>0);

$i = 0;
foreach ($list as $item)
{
	if ( !$g_session->IsActive() || ($g_session->IsActive() && $item['h']==0) ) {
		if ($i++ > 0)
		{
			echo '<img src="'.$r.'images/top_menu_sep.gif" width="1" height="19" alt="" border="0" align="middle" hspace="14">';
		}
	
	
		echo make_link($item['p'],
			'<a href="[%HREF%]" class="aTopMenu">[%TEXT%]</a>',
			'<span class="w3color">[%TEXT%]</span>',
			array(
				'HREF'=>$r.$g_site_struct[$item['p']]['l'],
				'TEXT'=>$item['t'])
		);
	}
}
?>

    </td>
</tr>
</table>



</td></tr>
<? $h = ( $p != "cp" ? "100%" : "" ); /* TODO: workaround */ ?>
<tr><td valign="top" height="<?=$h?>">

<?php
/* *********************************************************** */
/* *****             MAIN Reactangle: BEGIN              ***** */
/* *********************************************************** */
$h = ( $p != "cp" ? "100%" : "" ); /* TODO: workaround */
$g_html_rect_main->PrintBegin(array('w'=>"100%", 'h'=>$h));
?>

<table width="100%" height="<?=$h?>" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td>



<?php
$g_non_standart_page_list = array(
    "home"
);

if (!in_array($p, $g_non_standart_page_list)) {
$h = ( $p != "cp" ? "100%" : "" ); /* TODO: workaround */
?>
<table width="100%" height="<?=$h?>" border="0"
    cellspacing="<?php echo $g_main_table_cellspacing; ?>"
    cellpadding="<?php echo $g_main_table_cellpadding; ?>">
<tr>
    <td colspan="2" height="1">
    <?php echo PrintPageTitle($title); ?>
    </td>
</tr>
<?php } ?>


<?php if (@$g_site_struct[$p]['simple_page']) { ?>
<tr>
    <td>
<?php
/* ************************************************ */
/* *****             PAGE - BEGIN             ***** */
/* ************************************************ */
$h = ( $p != "cp" ? "100%" : "" ); /* TODO: workaround */
$g_html_rect_white_area->PrintBegin(array('w'=>"100%", 'h'=>$h, 'td_style'=>"padding-left: 10;"));
?>
<?php } ?>

